{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/lab466/pythons/pyMLIA35/Ch06SVM'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "###########From MLIA chap06 SVM\n",
    "import os\n",
    "os.chdir(\"/home/lab466/pythons/pyMLIA35/Ch06SVM\")\n",
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#coding=utf-8\n",
    "from numpy import *\n",
    "from time import sleep\n",
    "import math\n",
    "import scipy.io as sio"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def loadDataSet(filename):\n",
    "    dataMat=[];labelMat=[]\n",
    "    fr=open(filename)\n",
    "    for line in fr.readlines():\n",
    "        lineArr=line.strip().split('\\t')\n",
    "        dataMat.append([float(lineArr[0]),float(lineArr[1])])\n",
    "        labelMat.append(float(lineArr[2]))\n",
    "    return dataMat,labelMat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def selectJrand(i,m): #i表示alpha的下标，m表示alpha的总数\n",
    "    j=i\n",
    "    while(j==i):\n",
    "        j=int(random.uniform(0,m)) #简化版SMO，alpha随机选择\n",
    "    return j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def clipAlpha(aj,H,L): #辅助函数，用于调整alpha范围\n",
    "    if aj>H:\n",
    "        aj=H\n",
    "    if L>aj:\n",
    "        aj=L\n",
    "    return aj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#SMO simple algorithm\n",
    "def smoSimple(dataMatIn, classLabels, C, toler, maxIter):#toler表示容错率 常数C\n",
    "    dataMatrix = mat(dataMatIn); labelMat = mat(classLabels).transpose()\n",
    "    b = 0; m,n = shape(dataMatrix)\n",
    "    alphas = mat(zeros((m,1)))\n",
    "    iter = 0\n",
    "    while (iter < maxIter):\n",
    "        alphaPairsChanged = 0   #  标记alpha是否被优化\n",
    "        for i in range(m):\n",
    "            # fXi是预测的类别\n",
    "            fXi = float(multiply(alphas,labelMat).T*(dataMatrix*dataMatrix[i,:].T)) + b\n",
    "            # Ei表示误差\n",
    "            Ei = fXi - float(labelMat[i])# 预测结果和真实结果比对，计算误差\n",
    "            # 对alpha进行优化，同时检查alpha的值满足两个条件：if\n",
    "            if ((labelMat[i]*Ei < -toler) and (alphas[i] < C)) or ((labelMat[i]*Ei > toler) and (alphas[i] > 0)):\n",
    "                j = selectJrand(i,m)# 随机选择第二个alpha\n",
    "                fXj = float(multiply(alphas,labelMat).T*(dataMatrix*dataMatrix[j,:].T)) + b\n",
    "                Ej = fXj - float(labelMat[j])\n",
    "                alphaIold = alphas[i].copy(); alphaJold = alphas[j].copy(); # 分配内存 稍后比较误差\n",
    "                if (labelMat[i] != labelMat[j]): # 计算L H用于将alpha[j]调整到0—C之间\n",
    "                    L = max(0, alphas[j] - alphas[i])\n",
    "                    H = min(C, C + alphas[j] - alphas[i])\n",
    "                else:\n",
    "                    L = max(0, alphas[j] + alphas[i] - C)\n",
    "                    H = min(C, alphas[j] + alphas[i])\n",
    "                if L==H: print (\"L==H\"); continue  # eta为alpha[j]的最优修改量\n",
    "                eta = 2.0 * dataMatrix[i,:]*dataMatrix[j,:].T - dataMatrix[i,:]*dataMatrix[i,:].T - dataMatrix[j,:]*dataMatrix[j,:].T\n",
    "                if eta >= 0: print (\"eta>=0\"); continue\n",
    "                alphas[j] -= labelMat[j]*(Ei - Ej)/eta\n",
    "                alphas[j] = clipAlpha(alphas[j],H,L)\n",
    "                # 检查alpha[j]是否有轻微改变\n",
    "                if (abs(alphas[j] - alphaJold) < 0.00001): print (\"j not moving enough\"); continue\n",
    "                alphas[i] += labelMat[j]*labelMat[i]*(alphaJold - alphas[j])#update i by the same amount as j\n",
    "                                                                        #the update is in the oppostie direction\n",
    "                b1 = b - Ei- labelMat[i]*(alphas[i]-alphaIold)*dataMatrix[i,:]*dataMatrix[i,:].T - labelMat[j]*(alphas[j]-alphaJold)*dataMatrix[i,:]*dataMatrix[j,:].T\n",
    "                b2 = b - Ej- labelMat[i]*(alphas[i]-alphaIold)*dataMatrix[i,:]*dataMatrix[j,:].T - labelMat[j]*(alphas[j]-alphaJold)*dataMatrix[j,:]*dataMatrix[j,:].T\n",
    "                if (0 < alphas[i]) and (C > alphas[i]): b = b1\n",
    "                elif (0 < alphas[j]) and (C > alphas[j]): b = b2\n",
    "                else: b = (b1 + b2)/2.0\n",
    "                alphaPairsChanged += 1\n",
    "                print (\"iter: %d i:%d, pairs changed %d\" % (iter,i,alphaPairsChanged))\n",
    "        if (alphaPairsChanged == 0): iter += 1\n",
    "        else: iter = 0\n",
    "        print (\"iteration number: %d\" % iter)\n",
    "    return b,alphas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def kernelTrans(X, A, kTup): #calc the kernel or transform data to a higher dimensional space\n",
    "    m,n = shape(X)     #X is the type of kernel and the other two parameters are optional parameter\n",
    "    K = mat(zeros((m,1)))\n",
    "    if kTup[0]=='lin': K = X * A.T   #linear kernel\n",
    "    elif kTup[0]=='rbf':\n",
    "        for j in range(m): #compute the guassian\n",
    "            deltaRow = X[j,:] - A\n",
    "            K[j] = deltaRow*deltaRow.T\n",
    "        K = exp(K/(-1*kTup[1]**2)) #numpy中除法意味着对矩阵展开计算而不是matlab的求矩阵的逆\n",
    "    #如果遇到无法识别的元祖，程序抛出异常\n",
    "    else: raise NameError('Houston We Have a Problem -- That Kernel is not recognized')\n",
    "    return K"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class optStruct:  #保存所有重要值，实现对成员变量的填充\n",
    "    def __init__(self,dataMatIn, classLabels, C, toler, kTup):  # Initialize the structure with the parameters\n",
    "        self.X = dataMatIn\n",
    "        self.labelMat = classLabels\n",
    "        self.C = C\n",
    "        self.tol = toler\n",
    "        self.m = shape(dataMatIn)[0]\n",
    "        self.alphas = mat(zeros((self.m,1)))\n",
    "        self.b = 0\n",
    "        self.eCache = mat(zeros((self.m,2))) #误差缓存\n",
    "        self.K = mat(zeros((self.m,self.m)))\n",
    "        for i in range(self.m):\n",
    "            self.K[:,i] = kernelTrans(self.X, self.X[i,:], kTup)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def calcEk(oS, k):#计算误差\n",
    "    fXk = float(multiply(oS.alphas,oS.labelMat).T*oS.K[:,k] + oS.b)\n",
    "    Ek = fXk - float(oS.labelMat[k])\n",
    "    return Ek"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def selectJ(i,oS,Ei): #选择第二个alpha值以保证每次优化的最大步长（内循环）change English~\n",
    "    maxK=-1; maxDeltaE=0; Ej=0\n",
    "    oS.eCache[i]=[1,Ei] #input Ei\n",
    "    validEcacheList=nonzero(oS.eCache[:,0].A)[0] #set Ei valid in cache，nonzero is a list\n",
    "    #choose the num which change most, if the first choice: use random\n",
    "    if(len(validEcacheList))>1:\n",
    "        for k in validEcacheList:\n",
    "            if k==i:continue\n",
    "            Ek=calcEk(oS,k)\n",
    "            deltaE=abs(Ei-Ek)\n",
    "            if(deltaE>maxDeltaE):\n",
    "                maxK=k; maxDeltaE=deltaE; Ej=Ek\n",
    "        return maxK,Ej\n",
    "    else:\n",
    "        j=selectJrand(i,oS.m)\n",
    "        Ej=calcEk(oS,j)\n",
    "    return j,Ej"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def updateEk(oS, k):#after any alpha has changed update the new value in the cache\n",
    "    Ek = calcEk(oS, k)\n",
    "    oS.eCache[k] = [1,Ek]\n",
    "\n",
    "def innerL(i, oS):\n",
    "    Ei = calcEk(oS, i)\n",
    "    if ((oS.labelMat[i]*Ei < -oS.tol) and (oS.alphas[i] < oS.C)) or ((oS.labelMat[i]*Ei > oS.tol) and (oS.alphas[i] > 0)):\n",
    "        j,Ej = selectJ(i, oS, Ei) #this has been changed from selectJrand\n",
    "        alphaIold = oS.alphas[i].copy(); alphaJold = oS.alphas[j].copy();\n",
    "        if (oS.labelMat[i] != oS.labelMat[j]):\n",
    "            L = max(0, oS.alphas[j] - oS.alphas[i])\n",
    "            H = min(oS.C, oS.C + oS.alphas[j] - oS.alphas[i])\n",
    "        else:\n",
    "            L = max(0, oS.alphas[j] + oS.alphas[i] - oS.C)\n",
    "            H = min(oS.C, oS.alphas[j] + oS.alphas[i])\n",
    "        if L==H: print (\"L==H\"); return 0\n",
    "        eta = 2.0 * oS.K[i,j] - oS.K[i,i] - oS.K[j,j] #changed for kernel\n",
    "        if eta >= 0: print (\"eta>=0\"); return 0\n",
    "        oS.alphas[j] -= oS.labelMat[j]*(Ei - Ej)/eta\n",
    "        oS.alphas[j] = clipAlpha(oS.alphas[j],H,L)\n",
    "        updateEk(oS, j) #added this for the Ecache\n",
    "        if (abs(oS.alphas[j] - alphaJold) < 0.00001): print (\"j not moving enough\"); return 0\n",
    "        oS.alphas[i] += oS.labelMat[j]*oS.labelMat[i]*(alphaJold - oS.alphas[j])#update i by the same amount as j\n",
    "        updateEk(oS, i) #added this for the Ecache                    #the update is in the oppostie direction\n",
    "        b1 = oS.b - Ei- oS.labelMat[i]*(oS.alphas[i]-alphaIold)*oS.K[i,i] - oS.labelMat[j]*(oS.alphas[j]-alphaJold)*oS.K[i,j]\n",
    "        b2 = oS.b - Ej- oS.labelMat[i]*(oS.alphas[i]-alphaIold)*oS.K[i,j]- oS.labelMat[j]*(oS.alphas[j]-alphaJold)*oS.K[j,j]\n",
    "        if (0 < oS.alphas[i]) and (oS.C > oS.alphas[i]): oS.b = b1\n",
    "        elif (0 < oS.alphas[j]) and (oS.C > oS.alphas[j]): oS.b = b2\n",
    "        else: oS.b = (b1 + b2)/2.0\n",
    "        return 1\n",
    "    else: return 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#full Platt SMO\n",
    "def smoP(dataMatIn, classLabels, C, toler, maxIter,kTup=('lin', 0)):    #full Platt SMO\n",
    "    oS = optStruct(mat(dataMatIn),mat(classLabels).transpose(),C,toler, kTup)\n",
    "    iter = 0\n",
    "    entireSet = True; alphaPairsChanged = 0\n",
    "    # 当迭代超过maxIter或者整个数据集都未对任意alpha进行修改时，退出循环\n",
    "    while (iter < maxIter) and ((alphaPairsChanged > 0) or (entireSet)):\n",
    "        alphaPairsChanged = 0\n",
    "        if entireSet:   #go over all\n",
    "            for i in range(oS.m):\n",
    "                alphaPairsChanged += innerL(i,oS)#use innerL to choose the second alpha\n",
    "                print (\"fullSet, iter: %d i:%d, pairs changed %d\" % (iter,i,alphaPairsChanged))\n",
    "            iter += 1\n",
    "        else:#go over non-bound (railed) alphas\n",
    "            nonBoundIs = nonzero((oS.alphas.A > 0) * (oS.alphas.A < C))[0]\n",
    "            for i in nonBoundIs:\n",
    "                alphaPairsChanged += innerL(i,oS)\n",
    "                print (\"non-bound, iter: %d i:%d, pairs changed %d\" % (iter,i,alphaPairsChanged))\n",
    "            iter += 1\n",
    "        if entireSet: entireSet = False #toggle entire set loop\n",
    "        elif (alphaPairsChanged == 0): entireSet = True\n",
    "        print (\"iteration number: %d\" % iter)\n",
    "    return oS.b,oS.alphas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#由alpha得到权值w\n",
    "\n",
    "def calcWs(alphas,dataArr,classLabels):\n",
    "    X = mat(dataArr); labelMat = mat(classLabels).transpose()\n",
    "    m,n = shape(X)\n",
    "    w = zeros((n,1))\n",
    "    for i in range(m):\n",
    "        w += multiply(alphas[i]*labelMat[i],X[i,:].T)\n",
    "    return w"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def testRbf(k1=0.1):\n",
    "    dataArr,labelArr=loadDataSet('testSetRBF.txt')\n",
    "    b, alphas = smoP(dataArr, labelArr, 200, 0.0001, 10000, ('rbf', k1))  # C=200 important\n",
    "    datMat=mat(dataArr); labelMat=mat(labelArr).transpose()\n",
    "    svInd=nonzero(alphas.A>0)[0] #找到非零的alpha值，从而得到所需的支持向量\n",
    "    #支持向量：数据点指向超平面的长度表示距离的方向向量\n",
    "    sVs=datMat[svInd]\n",
    "    labelSV = labelMat[svInd]; #alpha类别标签值\n",
    "    print(\"there are %d Support Vectors\" % shape(sVs)[0])\n",
    "    m, n = shape(datMat)\n",
    "    errorCount = 0\n",
    "    for i in range(m):\n",
    "        kernelEval = kernelTrans(sVs, datMat[i, :], ('rbf', k1))\n",
    "        predict = kernelEval.T * multiply(labelSV, alphas[svInd]) + b\n",
    "        if sign(predict) != sign(labelArr[i]): errorCount += 1\n",
    "    print(\"the training error rate is: %f\" % (float(errorCount) / m))\n",
    "    #不同数据集\n",
    "    dataArr, labelArr = loadDataSet('testSetRBF2.txt')\n",
    "    errorCount = 0\n",
    "    datMat = mat(dataArr);\n",
    "    labelMat = mat(labelArr).transpose()\n",
    "    m, n = shape(datMat)\n",
    "    for i in range(m):\n",
    "        kernelEval = kernelTrans(sVs, datMat[i, :], ('rbf', k1))\n",
    "        predict = kernelEval.T * multiply(labelSV, alphas[svInd]) + b\n",
    "        if sign(predict) != sign(labelArr[i]): errorCount += 1\n",
    "    print(\"the test error rate is: %f\" % (float(errorCount) / m))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#示例：手写识别\n",
    "#准备数据：把二值化图像转化为向量\n",
    "def img2vector(filename):\n",
    "    returnVect = zeros((1,1024))\n",
    "    fr = open(filename)\n",
    "    for i in range(32):\n",
    "        lineStr = fr.readline()\n",
    "        for j in range(32):\n",
    "            returnVect[0,32*i+j] = int(lineStr[j])\n",
    "    return returnVect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#收集数据：导入数据集\n",
    "def loadImages(dirName):\n",
    "    from os import listdir\n",
    "    hwLabels=[]\n",
    "    trainingFileList=listdir(dirName)\n",
    "    m=len(trainingFileList)\n",
    "    trainingMat=zeros((m,1024))\n",
    "    for i in range(m):\n",
    "        fileNameStr = trainingFileList[i]\n",
    "        fileStr = fileNameStr.split('.')[0]     #take off .txt\n",
    "        classNumStr = int(fileStr.split('_')[0])\n",
    "        #这里是二分类问题，只分类数字1和9，数字分类结果为9时返回-1\n",
    "        if classNumStr == 9: hwLabels.append(-1)\n",
    "        else: hwLabels.append(1)\n",
    "        trainingMat[i,:] = img2vector('%s/%s' % (dirName, fileNameStr))\n",
    "    return trainingMat, hwLabels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#测试算法（调用训练算法函数smoP）\n",
    "def testDigits(kTup=('rbf', 10)): #与之前的testrbf函数差别不大，loadImages和核函数kTup选择输入，默认rbf类别\n",
    "    dataArr,labelArr = loadImages('trainingDigits')\n",
    "    b,alphas = smoP(dataArr, labelArr, 200, 0.0001, 10000, kTup)\n",
    "    datMat=mat(dataArr); labelMat = mat(labelArr).transpose()\n",
    "    svInd=nonzero(alphas.A>0)[0]\n",
    "    sVs=datMat[svInd]\n",
    "    labelSV = labelMat[svInd];\n",
    "    print (\"there are %d Support Vectors\" % shape(sVs)[0])\n",
    "    m,n = shape(datMat)\n",
    "    errorCount = 0\n",
    "    for i in range(m):\n",
    "        kernelEval = kernelTrans(sVs,datMat[i,:],kTup)\n",
    "        predict=kernelEval.T * multiply(labelSV,alphas[svInd]) + b\n",
    "        if sign(predict)!=sign(labelArr[i]): errorCount += 1\n",
    "    print (\"the training error rate is: %f\" % (float(errorCount)/m))\n",
    "    dataArr,labelArr = loadImages('testDigits')\n",
    "    errorCount = 0\n",
    "    datMat=mat(dataArr); labelMat = mat(labelArr).transpose()\n",
    "    m,n = shape(datMat)\n",
    "    for i in range(m):\n",
    "        kernelEval = kernelTrans(sVs,datMat[i,:],kTup)\n",
    "        predict=kernelEval.T * multiply(labelSV,alphas[svInd]) + b\n",
    "        if sign(predict)!=sign(labelArr[i]): errorCount += 1\n",
    "    print (\"the test error rate is: %f\" % (float(errorCount)/m) )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "dataArr,labelArr = loadDataSet('testSet.txt')\n",
    "#dataArr\n",
    "#labelArr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "L==H\n",
      "iter: 0 i:1, pairs changed 1\n",
      "L==H\n",
      "L==H\n",
      "iter: 0 i:5, pairs changed 2\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "iter: 0 i:26, pairs changed 3\n",
      "j not moving enough\n",
      "iter: 0 i:29, pairs changed 4\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:5, pairs changed 1\n",
      "iter: 0 i:12, pairs changed 2\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iter: 0 i:29, pairs changed 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:1, pairs changed 1\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:26, pairs changed 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "iter: 0 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iter: 0 i:57, pairs changed 2\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:1, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "L==H\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iter: 0 i:57, pairs changed 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:95, pairs changed 3\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:52, pairs changed 1\n",
      "L==H\n",
      "j not moving enough\n",
      "iter: 0 i:69, pairs changed 2\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "iter: 0 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:52, pairs changed 2\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:86, pairs changed 3\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:22, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:27, pairs changed 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:54, pairs changed 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:69, pairs changed 4\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:30, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:96, pairs changed 2\n",
      "L==H\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "iter: 0 i:1, pairs changed 1\n",
      "L==H\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iter: 0 i:29, pairs changed 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:52, pairs changed 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "iter: 0 i:69, pairs changed 4\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "iter: 0 i:8, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:34, pairs changed 1\n",
      "j not moving enough\n",
      "iter: 0 i:54, pairs changed 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:69, pairs changed 1\n",
      "iteration number: 0\n",
      "iter: 0 i:5, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:29, pairs changed 1\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "iter: 1 i:8, pairs changed 1\n",
      "L==H\n",
      "iter: 1 i:17, pairs changed 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:54, pairs changed 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "iter: 2 i:17, pairs changed 1\n",
      "iter: 2 i:23, pairs changed 2\n",
      "j not moving enough\n",
      "L==H\n",
      "iter: 2 i:54, pairs changed 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:8, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "iter: 2 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 4 i:29, pairs changed 1\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iter: 3 i:55, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "iter: 10 i:26, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "iter: 1 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "iter: 1 i:55, pairs changed 2\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 5 i:69, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 2 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 11 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "iter: 0 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 3 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 22\n",
      "j not moving enough\n",
      "iter: 22 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "iter: 17 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "iter: 5 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "iter: 5 i:54, pairs changed 2\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "iter: 5 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "iter: 1 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 11 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "iter: 16 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "iter: 1 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "iter: 15 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 4 i:54, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:52, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "L==H\n",
      "iter: 11 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "iter: 1 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "iter: 1 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "iter: 1 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "iter: 2 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 3 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "iter: 3 i:23, pairs changed 1\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 7 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 2 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 7 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "iter: 19 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "iter: 10 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "iter: 2 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 1 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 0 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "iter: 10 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "iter: 0 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 6 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "iter: 0 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "iter: 1 i:54, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 18 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "iter: 21 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 13 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "iter: 7 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "iter: 19 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "iter: 2 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "iter: 2 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "iter: 1 i:54, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "iter: 12 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "iter: 15 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "iter: 6 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 22\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 23\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 24\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 25\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 26\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 27\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 28\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 29\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 30\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 31\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 32\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 33\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 34\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 35\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 36\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 37\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 38\n",
      "j not moving enough\n",
      "iter: 38 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "iter: 21 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 22\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 23\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 24\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 25\n",
      "iter: 25 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 22\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 23\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 24\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 25\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 26\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 27\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 28\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 29\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 30\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 31\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 32\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 33\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 34\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 35\n",
      "iter: 35 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "L==H\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "iter: 5 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iter: 2 i:54, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "iter: 8 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 22\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 23\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 24\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 25\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 26\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 27\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 28\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 29\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 30\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 31\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 32\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 33\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 34\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 35\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 36\n",
      "iter: 36 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "iter: 0 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "iter: 3 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "iter: 14 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "iter: 11 i:55, pairs changed 1\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "iter: 10 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "iter: 9 i:17, pairs changed 1\n",
      "j not moving enough\n",
      "iteration number: 0\n",
      "j not moving enough\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "iteration number: 4\n",
      "j not moving enough\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "iteration number: 7\n",
      "j not moving enough\n",
      "iteration number: 8\n",
      "j not moving enough\n",
      "iteration number: 9\n",
      "j not moving enough\n",
      "iteration number: 10\n",
      "j not moving enough\n",
      "iteration number: 11\n",
      "j not moving enough\n",
      "iteration number: 12\n",
      "j not moving enough\n",
      "iteration number: 13\n",
      "j not moving enough\n",
      "iteration number: 14\n",
      "j not moving enough\n",
      "iteration number: 15\n",
      "j not moving enough\n",
      "iteration number: 16\n",
      "j not moving enough\n",
      "iteration number: 17\n",
      "j not moving enough\n",
      "iteration number: 18\n",
      "j not moving enough\n",
      "iteration number: 19\n",
      "j not moving enough\n",
      "iteration number: 20\n",
      "j not moving enough\n",
      "iteration number: 21\n",
      "j not moving enough\n",
      "iteration number: 22\n",
      "j not moving enough\n",
      "iteration number: 23\n",
      "j not moving enough\n",
      "iteration number: 24\n",
      "j not moving enough\n",
      "iteration number: 25\n",
      "j not moving enough\n",
      "iteration number: 26\n",
      "j not moving enough\n",
      "iteration number: 27\n",
      "j not moving enough\n",
      "iteration number: 28\n",
      "j not moving enough\n",
      "iteration number: 29\n",
      "j not moving enough\n",
      "iteration number: 30\n",
      "j not moving enough\n",
      "iteration number: 31\n",
      "j not moving enough\n",
      "iteration number: 32\n",
      "j not moving enough\n",
      "iteration number: 33\n",
      "j not moving enough\n",
      "iteration number: 34\n",
      "j not moving enough\n",
      "iteration number: 35\n",
      "j not moving enough\n",
      "iteration number: 36\n",
      "j not moving enough\n",
      "iteration number: 37\n",
      "j not moving enough\n",
      "iteration number: 38\n",
      "j not moving enough\n",
      "iteration number: 39\n",
      "j not moving enough\n",
      "iteration number: 40\n"
     ]
    }
   ],
   "source": [
    "b,alphas = smoSimple(dataArr, labelArr, 0.6, 0.001, 40)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[-3.80157199]])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[0.12785371, 0.23890308, 0.36675679]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alphas[alphas>0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1, 3)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "shape(alphas[alphas>0])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[4.658191, 3.507396] -1.0\n",
      "[3.457096, -0.082216] -1.0\n",
      "[6.080573, 0.418886] 1.0\n"
     ]
    }
   ],
   "source": [
    "for i in range(100):\n",
    "    if alphas[i]>0.0: \n",
    "        print (dataArr[i],labelArr[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "L==H\n",
      "fullSet, iter: 0 i:0, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 0 i:1, pairs changed 0\n",
      "fullSet, iter: 0 i:2, pairs changed 1\n",
      "L==H\n",
      "fullSet, iter: 0 i:3, pairs changed 1\n",
      "fullSet, iter: 0 i:4, pairs changed 2\n",
      "fullSet, iter: 0 i:5, pairs changed 2\n",
      "fullSet, iter: 0 i:6, pairs changed 2\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:7, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 0 i:8, pairs changed 2\n",
      "fullSet, iter: 0 i:9, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 0 i:10, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 0 i:11, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 0 i:12, pairs changed 2\n",
      "fullSet, iter: 0 i:13, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 0 i:14, pairs changed 2\n",
      "fullSet, iter: 0 i:15, pairs changed 2\n",
      "fullSet, iter: 0 i:16, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 0 i:17, pairs changed 2\n",
      "fullSet, iter: 0 i:18, pairs changed 3\n",
      "fullSet, iter: 0 i:19, pairs changed 3\n",
      "fullSet, iter: 0 i:20, pairs changed 3\n",
      "fullSet, iter: 0 i:21, pairs changed 3\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:22, pairs changed 3\n",
      "L==H\n",
      "fullSet, iter: 0 i:23, pairs changed 3\n",
      "L==H\n",
      "fullSet, iter: 0 i:24, pairs changed 3\n",
      "fullSet, iter: 0 i:25, pairs changed 4\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:26, pairs changed 4\n",
      "fullSet, iter: 0 i:27, pairs changed 4\n",
      "fullSet, iter: 0 i:28, pairs changed 4\n",
      "L==H\n",
      "fullSet, iter: 0 i:29, pairs changed 4\n",
      "fullSet, iter: 0 i:30, pairs changed 4\n",
      "fullSet, iter: 0 i:31, pairs changed 4\n",
      "fullSet, iter: 0 i:32, pairs changed 4\n",
      "fullSet, iter: 0 i:33, pairs changed 4\n",
      "fullSet, iter: 0 i:34, pairs changed 4\n",
      "fullSet, iter: 0 i:35, pairs changed 4\n",
      "fullSet, iter: 0 i:36, pairs changed 4\n",
      "fullSet, iter: 0 i:37, pairs changed 4\n",
      "fullSet, iter: 0 i:38, pairs changed 4\n",
      "fullSet, iter: 0 i:39, pairs changed 4\n",
      "fullSet, iter: 0 i:40, pairs changed 4\n",
      "fullSet, iter: 0 i:41, pairs changed 4\n",
      "fullSet, iter: 0 i:42, pairs changed 4\n",
      "fullSet, iter: 0 i:43, pairs changed 4\n",
      "fullSet, iter: 0 i:44, pairs changed 4\n",
      "fullSet, iter: 0 i:45, pairs changed 4\n",
      "fullSet, iter: 0 i:46, pairs changed 5\n",
      "fullSet, iter: 0 i:47, pairs changed 5\n",
      "fullSet, iter: 0 i:48, pairs changed 5\n",
      "fullSet, iter: 0 i:49, pairs changed 5\n",
      "fullSet, iter: 0 i:50, pairs changed 5\n",
      "fullSet, iter: 0 i:51, pairs changed 5\n",
      "L==H\n",
      "fullSet, iter: 0 i:52, pairs changed 5\n",
      "fullSet, iter: 0 i:53, pairs changed 5\n",
      "L==H\n",
      "fullSet, iter: 0 i:54, pairs changed 5\n",
      "L==H\n",
      "fullSet, iter: 0 i:55, pairs changed 5\n",
      "fullSet, iter: 0 i:56, pairs changed 5\n",
      "fullSet, iter: 0 i:57, pairs changed 5\n",
      "fullSet, iter: 0 i:58, pairs changed 5\n",
      "fullSet, iter: 0 i:59, pairs changed 5\n",
      "fullSet, iter: 0 i:60, pairs changed 5\n",
      "fullSet, iter: 0 i:61, pairs changed 5\n",
      "fullSet, iter: 0 i:62, pairs changed 5\n",
      "fullSet, iter: 0 i:63, pairs changed 5\n",
      "fullSet, iter: 0 i:64, pairs changed 5\n",
      "fullSet, iter: 0 i:65, pairs changed 5\n",
      "fullSet, iter: 0 i:66, pairs changed 5\n",
      "fullSet, iter: 0 i:67, pairs changed 5\n",
      "fullSet, iter: 0 i:68, pairs changed 5\n",
      "L==H\n",
      "fullSet, iter: 0 i:69, pairs changed 5\n",
      "fullSet, iter: 0 i:70, pairs changed 5\n",
      "fullSet, iter: 0 i:71, pairs changed 5\n",
      "fullSet, iter: 0 i:72, pairs changed 5\n",
      "fullSet, iter: 0 i:73, pairs changed 5\n",
      "fullSet, iter: 0 i:74, pairs changed 5\n",
      "fullSet, iter: 0 i:75, pairs changed 5\n",
      "fullSet, iter: 0 i:76, pairs changed 5\n",
      "fullSet, iter: 0 i:77, pairs changed 5\n",
      "fullSet, iter: 0 i:78, pairs changed 5\n",
      "fullSet, iter: 0 i:79, pairs changed 5\n",
      "fullSet, iter: 0 i:80, pairs changed 5\n",
      "fullSet, iter: 0 i:81, pairs changed 5\n",
      "fullSet, iter: 0 i:82, pairs changed 5\n",
      "fullSet, iter: 0 i:83, pairs changed 5\n",
      "fullSet, iter: 0 i:84, pairs changed 5\n",
      "fullSet, iter: 0 i:85, pairs changed 5\n",
      "fullSet, iter: 0 i:86, pairs changed 5\n",
      "fullSet, iter: 0 i:87, pairs changed 5\n",
      "fullSet, iter: 0 i:88, pairs changed 5\n",
      "fullSet, iter: 0 i:89, pairs changed 5\n",
      "fullSet, iter: 0 i:90, pairs changed 5\n",
      "fullSet, iter: 0 i:91, pairs changed 5\n",
      "fullSet, iter: 0 i:92, pairs changed 5\n",
      "fullSet, iter: 0 i:93, pairs changed 5\n",
      "fullSet, iter: 0 i:94, pairs changed 6\n",
      "fullSet, iter: 0 i:95, pairs changed 6\n",
      "fullSet, iter: 0 i:96, pairs changed 6\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:97, pairs changed 6\n",
      "fullSet, iter: 0 i:98, pairs changed 6\n",
      "fullSet, iter: 0 i:99, pairs changed 6\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:0, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:4, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:17, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:46, pairs changed 0\n",
      "non-bound, iter: 1 i:55, pairs changed 0\n",
      "non-bound, iter: 1 i:94, pairs changed 0\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:0, pairs changed 0\n",
      "fullSet, iter: 2 i:1, pairs changed 0\n",
      "fullSet, iter: 2 i:2, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:4, pairs changed 0\n",
      "fullSet, iter: 2 i:5, pairs changed 0\n",
      "fullSet, iter: 2 i:6, pairs changed 0\n",
      "fullSet, iter: 2 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:8, pairs changed 0\n",
      "fullSet, iter: 2 i:9, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:10, pairs changed 0\n",
      "fullSet, iter: 2 i:11, pairs changed 0\n",
      "fullSet, iter: 2 i:12, pairs changed 0\n",
      "fullSet, iter: 2 i:13, pairs changed 0\n",
      "fullSet, iter: 2 i:14, pairs changed 0\n",
      "fullSet, iter: 2 i:15, pairs changed 0\n",
      "fullSet, iter: 2 i:16, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:17, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:18, pairs changed 0\n",
      "fullSet, iter: 2 i:19, pairs changed 0\n",
      "fullSet, iter: 2 i:20, pairs changed 0\n",
      "fullSet, iter: 2 i:21, pairs changed 0\n",
      "fullSet, iter: 2 i:22, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 2 i:23, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:24, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:25, pairs changed 0\n",
      "fullSet, iter: 2 i:26, pairs changed 0\n",
      "fullSet, iter: 2 i:27, pairs changed 0\n",
      "fullSet, iter: 2 i:28, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 2 i:29, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:30, pairs changed 0\n",
      "fullSet, iter: 2 i:31, pairs changed 0\n",
      "fullSet, iter: 2 i:32, pairs changed 0\n",
      "fullSet, iter: 2 i:33, pairs changed 0\n",
      "fullSet, iter: 2 i:34, pairs changed 0\n",
      "fullSet, iter: 2 i:35, pairs changed 0\n",
      "fullSet, iter: 2 i:36, pairs changed 0\n",
      "fullSet, iter: 2 i:37, pairs changed 0\n",
      "fullSet, iter: 2 i:38, pairs changed 0\n",
      "fullSet, iter: 2 i:39, pairs changed 0\n",
      "fullSet, iter: 2 i:40, pairs changed 0\n",
      "fullSet, iter: 2 i:41, pairs changed 0\n",
      "fullSet, iter: 2 i:42, pairs changed 0\n",
      "fullSet, iter: 2 i:43, pairs changed 0\n",
      "fullSet, iter: 2 i:44, pairs changed 0\n",
      "fullSet, iter: 2 i:45, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:46, pairs changed 0\n",
      "fullSet, iter: 2 i:47, pairs changed 0\n",
      "fullSet, iter: 2 i:48, pairs changed 0\n",
      "fullSet, iter: 2 i:49, pairs changed 0\n",
      "fullSet, iter: 2 i:50, pairs changed 0\n",
      "fullSet, iter: 2 i:51, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 2 i:52, pairs changed 0\n",
      "fullSet, iter: 2 i:53, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 2 i:54, pairs changed 0\n",
      "fullSet, iter: 2 i:55, pairs changed 0\n",
      "fullSet, iter: 2 i:56, pairs changed 0\n",
      "fullSet, iter: 2 i:57, pairs changed 0\n",
      "fullSet, iter: 2 i:58, pairs changed 0\n",
      "fullSet, iter: 2 i:59, pairs changed 0\n",
      "fullSet, iter: 2 i:60, pairs changed 0\n",
      "fullSet, iter: 2 i:61, pairs changed 0\n",
      "fullSet, iter: 2 i:62, pairs changed 0\n",
      "fullSet, iter: 2 i:63, pairs changed 0\n",
      "fullSet, iter: 2 i:64, pairs changed 0\n",
      "fullSet, iter: 2 i:65, pairs changed 0\n",
      "fullSet, iter: 2 i:66, pairs changed 0\n",
      "fullSet, iter: 2 i:67, pairs changed 0\n",
      "fullSet, iter: 2 i:68, pairs changed 0\n",
      "fullSet, iter: 2 i:69, pairs changed 0\n",
      "fullSet, iter: 2 i:70, pairs changed 0\n",
      "fullSet, iter: 2 i:71, pairs changed 0\n",
      "fullSet, iter: 2 i:72, pairs changed 0\n",
      "fullSet, iter: 2 i:73, pairs changed 0\n",
      "fullSet, iter: 2 i:74, pairs changed 0\n",
      "fullSet, iter: 2 i:75, pairs changed 0\n",
      "fullSet, iter: 2 i:76, pairs changed 0\n",
      "fullSet, iter: 2 i:77, pairs changed 0\n",
      "fullSet, iter: 2 i:78, pairs changed 0\n",
      "fullSet, iter: 2 i:79, pairs changed 0\n",
      "fullSet, iter: 2 i:80, pairs changed 0\n",
      "fullSet, iter: 2 i:81, pairs changed 0\n",
      "fullSet, iter: 2 i:82, pairs changed 0\n",
      "fullSet, iter: 2 i:83, pairs changed 0\n",
      "fullSet, iter: 2 i:84, pairs changed 0\n",
      "fullSet, iter: 2 i:85, pairs changed 0\n",
      "fullSet, iter: 2 i:86, pairs changed 0\n",
      "fullSet, iter: 2 i:87, pairs changed 0\n",
      "fullSet, iter: 2 i:88, pairs changed 0\n",
      "fullSet, iter: 2 i:89, pairs changed 0\n",
      "fullSet, iter: 2 i:90, pairs changed 0\n",
      "fullSet, iter: 2 i:91, pairs changed 0\n",
      "fullSet, iter: 2 i:92, pairs changed 0\n",
      "fullSet, iter: 2 i:93, pairs changed 0\n",
      "fullSet, iter: 2 i:94, pairs changed 0\n",
      "fullSet, iter: 2 i:95, pairs changed 0\n",
      "fullSet, iter: 2 i:96, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 2 i:97, pairs changed 0\n",
      "fullSet, iter: 2 i:98, pairs changed 0\n",
      "fullSet, iter: 2 i:99, pairs changed 0\n",
      "iteration number: 3\n"
     ]
    }
   ],
   "source": [
    "#P68\n",
    "dataArr,labelArr = loadDataSet('testSet.txt')\n",
    "b,alphas = smoP(dataArr, labelArr, 0.6, 0.001, 40)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.65307162],\n",
       "       [-0.17196128]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ws=calcWs(alphas,dataArr,labelArr)\n",
    "ws\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[-0.92555695]])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datMat=mat(dataArr)\n",
    "datMat[0]*mat(ws)+b\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1.0"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "labelArr[0]\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[2.30436336]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#还可以继续检查其他数据分类结果的正确性：\n",
    "datMat[2]*mat(ws)+b\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "labelArr[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[-1.36706674]])"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datMat[1]*mat(ws)+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1.0"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "labelArr[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "L==H\n",
      "fullSet, iter: 0 i:0, pairs changed 0\n",
      "fullSet, iter: 0 i:1, pairs changed 1\n",
      "fullSet, iter: 0 i:2, pairs changed 2\n",
      "fullSet, iter: 0 i:3, pairs changed 3\n",
      "fullSet, iter: 0 i:4, pairs changed 4\n",
      "fullSet, iter: 0 i:5, pairs changed 5\n",
      "fullSet, iter: 0 i:6, pairs changed 6\n",
      "fullSet, iter: 0 i:7, pairs changed 7\n",
      "fullSet, iter: 0 i:8, pairs changed 8\n",
      "fullSet, iter: 0 i:9, pairs changed 9\n",
      "fullSet, iter: 0 i:10, pairs changed 10\n",
      "fullSet, iter: 0 i:11, pairs changed 11\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:12, pairs changed 11\n",
      "fullSet, iter: 0 i:13, pairs changed 12\n",
      "fullSet, iter: 0 i:14, pairs changed 13\n",
      "fullSet, iter: 0 i:15, pairs changed 14\n",
      "fullSet, iter: 0 i:16, pairs changed 15\n",
      "fullSet, iter: 0 i:17, pairs changed 16\n",
      "fullSet, iter: 0 i:18, pairs changed 17\n",
      "fullSet, iter: 0 i:19, pairs changed 18\n",
      "fullSet, iter: 0 i:20, pairs changed 19\n",
      "fullSet, iter: 0 i:21, pairs changed 20\n",
      "fullSet, iter: 0 i:22, pairs changed 21\n",
      "fullSet, iter: 0 i:23, pairs changed 22\n",
      "fullSet, iter: 0 i:24, pairs changed 23\n",
      "fullSet, iter: 0 i:25, pairs changed 24\n",
      "fullSet, iter: 0 i:26, pairs changed 25\n",
      "fullSet, iter: 0 i:27, pairs changed 26\n",
      "fullSet, iter: 0 i:28, pairs changed 27\n",
      "fullSet, iter: 0 i:29, pairs changed 28\n",
      "fullSet, iter: 0 i:30, pairs changed 29\n",
      "fullSet, iter: 0 i:31, pairs changed 30\n",
      "fullSet, iter: 0 i:32, pairs changed 31\n",
      "fullSet, iter: 0 i:33, pairs changed 32\n",
      "fullSet, iter: 0 i:34, pairs changed 33\n",
      "fullSet, iter: 0 i:35, pairs changed 34\n",
      "fullSet, iter: 0 i:36, pairs changed 35\n",
      "fullSet, iter: 0 i:37, pairs changed 36\n",
      "fullSet, iter: 0 i:38, pairs changed 37\n",
      "fullSet, iter: 0 i:39, pairs changed 38\n",
      "fullSet, iter: 0 i:40, pairs changed 39\n",
      "fullSet, iter: 0 i:41, pairs changed 40\n",
      "fullSet, iter: 0 i:42, pairs changed 41\n",
      "fullSet, iter: 0 i:43, pairs changed 42\n",
      "fullSet, iter: 0 i:44, pairs changed 43\n",
      "fullSet, iter: 0 i:45, pairs changed 44\n",
      "fullSet, iter: 0 i:46, pairs changed 45\n",
      "fullSet, iter: 0 i:47, pairs changed 46\n",
      "fullSet, iter: 0 i:48, pairs changed 47\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:49, pairs changed 47\n",
      "fullSet, iter: 0 i:50, pairs changed 48\n",
      "fullSet, iter: 0 i:51, pairs changed 48\n",
      "fullSet, iter: 0 i:52, pairs changed 49\n",
      "fullSet, iter: 0 i:53, pairs changed 50\n",
      "fullSet, iter: 0 i:54, pairs changed 51\n",
      "fullSet, iter: 0 i:55, pairs changed 52\n",
      "fullSet, iter: 0 i:56, pairs changed 53\n",
      "fullSet, iter: 0 i:57, pairs changed 54\n",
      "fullSet, iter: 0 i:58, pairs changed 55\n",
      "fullSet, iter: 0 i:59, pairs changed 56\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:60, pairs changed 56\n",
      "fullSet, iter: 0 i:61, pairs changed 57\n",
      "fullSet, iter: 0 i:62, pairs changed 58\n",
      "fullSet, iter: 0 i:63, pairs changed 59\n",
      "fullSet, iter: 0 i:64, pairs changed 60\n",
      "fullSet, iter: 0 i:65, pairs changed 61\n",
      "fullSet, iter: 0 i:66, pairs changed 62\n",
      "fullSet, iter: 0 i:67, pairs changed 63\n",
      "fullSet, iter: 0 i:68, pairs changed 64\n",
      "fullSet, iter: 0 i:69, pairs changed 65\n",
      "fullSet, iter: 0 i:70, pairs changed 66\n",
      "fullSet, iter: 0 i:71, pairs changed 66\n",
      "fullSet, iter: 0 i:72, pairs changed 67\n",
      "fullSet, iter: 0 i:73, pairs changed 68\n",
      "fullSet, iter: 0 i:74, pairs changed 69\n",
      "fullSet, iter: 0 i:75, pairs changed 70\n",
      "fullSet, iter: 0 i:76, pairs changed 71\n",
      "fullSet, iter: 0 i:77, pairs changed 72\n",
      "fullSet, iter: 0 i:78, pairs changed 73\n",
      "fullSet, iter: 0 i:79, pairs changed 74\n",
      "fullSet, iter: 0 i:80, pairs changed 74\n",
      "fullSet, iter: 0 i:81, pairs changed 75\n",
      "fullSet, iter: 0 i:82, pairs changed 75\n",
      "fullSet, iter: 0 i:83, pairs changed 75\n",
      "fullSet, iter: 0 i:84, pairs changed 75\n",
      "fullSet, iter: 0 i:85, pairs changed 76\n",
      "fullSet, iter: 0 i:86, pairs changed 76\n",
      "fullSet, iter: 0 i:87, pairs changed 77\n",
      "fullSet, iter: 0 i:88, pairs changed 78\n",
      "fullSet, iter: 0 i:89, pairs changed 79\n",
      "fullSet, iter: 0 i:90, pairs changed 80\n",
      "fullSet, iter: 0 i:91, pairs changed 81\n",
      "fullSet, iter: 0 i:92, pairs changed 81\n",
      "fullSet, iter: 0 i:93, pairs changed 82\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:94, pairs changed 82\n",
      "fullSet, iter: 0 i:95, pairs changed 82\n",
      "fullSet, iter: 0 i:96, pairs changed 82\n",
      "fullSet, iter: 0 i:97, pairs changed 83\n",
      "fullSet, iter: 0 i:98, pairs changed 84\n",
      "fullSet, iter: 0 i:99, pairs changed 85\n",
      "iteration number: 1\n",
      "non-bound, iter: 1 i:0, pairs changed 1\n",
      "non-bound, iter: 1 i:1, pairs changed 1\n",
      "non-bound, iter: 1 i:2, pairs changed 2\n",
      "non-bound, iter: 1 i:3, pairs changed 3\n",
      "non-bound, iter: 1 i:4, pairs changed 4\n",
      "non-bound, iter: 1 i:5, pairs changed 5\n",
      "non-bound, iter: 1 i:6, pairs changed 6\n",
      "non-bound, iter: 1 i:7, pairs changed 7\n",
      "non-bound, iter: 1 i:8, pairs changed 8\n",
      "non-bound, iter: 1 i:9, pairs changed 9\n",
      "non-bound, iter: 1 i:10, pairs changed 10\n",
      "non-bound, iter: 1 i:13, pairs changed 11\n",
      "non-bound, iter: 1 i:14, pairs changed 12\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:15, pairs changed 12\n",
      "non-bound, iter: 1 i:16, pairs changed 13\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:17, pairs changed 13\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:18, pairs changed 13\n",
      "non-bound, iter: 1 i:19, pairs changed 14\n",
      "non-bound, iter: 1 i:20, pairs changed 15\n",
      "non-bound, iter: 1 i:21, pairs changed 16\n",
      "non-bound, iter: 1 i:22, pairs changed 17\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:23, pairs changed 17\n",
      "non-bound, iter: 1 i:24, pairs changed 18\n",
      "non-bound, iter: 1 i:25, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:26, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:27, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:28, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:29, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:30, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:31, pairs changed 19\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:32, pairs changed 19\n",
      "non-bound, iter: 1 i:33, pairs changed 20\n",
      "non-bound, iter: 1 i:34, pairs changed 21\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:36, pairs changed 21\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:37, pairs changed 21\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:38, pairs changed 21\n",
      "non-bound, iter: 1 i:39, pairs changed 22\n",
      "non-bound, iter: 1 i:40, pairs changed 23\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:41, pairs changed 23\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:42, pairs changed 23\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:43, pairs changed 23\n",
      "non-bound, iter: 1 i:44, pairs changed 24\n",
      "non-bound, iter: 1 i:45, pairs changed 25\n",
      "non-bound, iter: 1 i:46, pairs changed 26\n",
      "non-bound, iter: 1 i:47, pairs changed 27\n",
      "non-bound, iter: 1 i:48, pairs changed 28\n",
      "non-bound, iter: 1 i:50, pairs changed 29\n",
      "non-bound, iter: 1 i:52, pairs changed 30\n",
      "non-bound, iter: 1 i:53, pairs changed 31\n",
      "non-bound, iter: 1 i:54, pairs changed 32\n",
      "non-bound, iter: 1 i:55, pairs changed 33\n",
      "non-bound, iter: 1 i:56, pairs changed 34\n",
      "non-bound, iter: 1 i:57, pairs changed 35\n",
      "non-bound, iter: 1 i:58, pairs changed 36\n",
      "non-bound, iter: 1 i:59, pairs changed 37\n",
      "non-bound, iter: 1 i:61, pairs changed 38\n",
      "non-bound, iter: 1 i:62, pairs changed 39\n",
      "non-bound, iter: 1 i:63, pairs changed 40\n",
      "non-bound, iter: 1 i:64, pairs changed 41\n",
      "non-bound, iter: 1 i:65, pairs changed 42\n",
      "non-bound, iter: 1 i:66, pairs changed 43\n",
      "non-bound, iter: 1 i:67, pairs changed 44\n",
      "non-bound, iter: 1 i:68, pairs changed 45\n",
      "non-bound, iter: 1 i:69, pairs changed 46\n",
      "non-bound, iter: 1 i:70, pairs changed 47\n",
      "non-bound, iter: 1 i:72, pairs changed 48\n",
      "non-bound, iter: 1 i:73, pairs changed 49\n",
      "non-bound, iter: 1 i:74, pairs changed 50\n",
      "non-bound, iter: 1 i:75, pairs changed 51\n",
      "non-bound, iter: 1 i:76, pairs changed 52\n",
      "non-bound, iter: 1 i:77, pairs changed 53\n",
      "non-bound, iter: 1 i:78, pairs changed 54\n",
      "non-bound, iter: 1 i:79, pairs changed 55\n",
      "non-bound, iter: 1 i:81, pairs changed 56\n",
      "non-bound, iter: 1 i:85, pairs changed 57\n",
      "non-bound, iter: 1 i:87, pairs changed 58\n",
      "non-bound, iter: 1 i:88, pairs changed 59\n",
      "non-bound, iter: 1 i:89, pairs changed 60\n",
      "non-bound, iter: 1 i:90, pairs changed 61\n",
      "non-bound, iter: 1 i:91, pairs changed 62\n",
      "non-bound, iter: 1 i:93, pairs changed 63\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:97, pairs changed 63\n",
      "non-bound, iter: 1 i:98, pairs changed 64\n",
      "non-bound, iter: 1 i:99, pairs changed 65\n",
      "iteration number: 2\n",
      "non-bound, iter: 2 i:0, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:1, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:2, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:3, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:4, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:5, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:6, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:7, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:8, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:9, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:10, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:12, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:13, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:14, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:15, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:16, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:18, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:19, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:20, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:21, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:22, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:23, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:24, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:25, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:26, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:27, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:28, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:29, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:30, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:31, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:32, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:33, pairs changed 1\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "non-bound, iter: 2 i:34, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:36, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:37, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:38, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:39, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:40, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:41, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:42, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:43, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:44, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:45, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:46, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:47, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:48, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:50, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:52, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:53, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:55, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:56, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:57, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:58, pairs changed 1\n",
      "non-bound, iter: 2 i:59, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:61, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:62, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:63, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:64, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:65, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:66, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:67, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:69, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:70, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:72, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:73, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:74, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:75, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:76, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:77, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:78, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:79, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:81, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:85, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:87, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:88, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:89, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:90, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:91, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:93, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:97, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:98, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:99, pairs changed 1\n",
      "iteration number: 3\n",
      "non-bound, iter: 3 i:0, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:1, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:2, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:4, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:5, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:6, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:8, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:9, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:10, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:12, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:13, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:14, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:15, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:16, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:19, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:20, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:21, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:22, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:23, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:24, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:26, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:27, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:28, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:29, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:30, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:31, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:32, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:33, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:34, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:36, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:37, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:38, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:39, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:40, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:41, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:42, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:43, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:44, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:45, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:46, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:47, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:48, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:50, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:52, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:53, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:54, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:55, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:56, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:57, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:58, pairs changed 0\n",
      "non-bound, iter: 3 i:59, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:61, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:62, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:63, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:64, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:65, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:66, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:67, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:69, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:70, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:72, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:73, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:74, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:75, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:76, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:77, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:78, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:79, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:81, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:85, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:87, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:88, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:89, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:90, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:91, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:93, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:97, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:98, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 3 i:99, pairs changed 0\n",
      "iteration number: 4\n",
      "fullSet, iter: 4 i:0, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:1, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:2, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:4, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:5, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:6, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:8, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:9, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:10, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:11, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:12, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:13, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:14, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:15, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:16, pairs changed 0\n",
      "fullSet, iter: 4 i:17, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:19, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:20, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:21, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:22, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:23, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:24, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:26, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:27, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:28, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:29, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:30, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:31, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:32, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:33, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:34, pairs changed 0\n",
      "fullSet, iter: 4 i:35, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:36, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:37, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:38, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:39, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:40, pairs changed 0\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fullSet, iter: 4 i:41, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:42, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:43, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:44, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:45, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:46, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:47, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:48, pairs changed 0\n",
      "fullSet, iter: 4 i:49, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:50, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 4 i:51, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:52, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:53, pairs changed 0\n",
      "fullSet, iter: 4 i:54, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:55, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:56, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:57, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:58, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:59, pairs changed 1\n",
      "fullSet, iter: 4 i:60, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:61, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:62, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:63, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:64, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:65, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:66, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:67, pairs changed 1\n",
      "fullSet, iter: 4 i:68, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:69, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:70, pairs changed 1\n",
      "fullSet, iter: 4 i:71, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:72, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:73, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:74, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:75, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:76, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:77, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:78, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:79, pairs changed 1\n",
      "fullSet, iter: 4 i:80, pairs changed 1\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:81, pairs changed 1\n",
      "fullSet, iter: 4 i:82, pairs changed 1\n",
      "L==H\n",
      "fullSet, iter: 4 i:83, pairs changed 1\n",
      "L==H\n",
      "fullSet, iter: 4 i:84, pairs changed 1\n",
      "fullSet, iter: 4 i:85, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 4 i:86, pairs changed 2\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:87, pairs changed 2\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:88, pairs changed 2\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:89, pairs changed 2\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:90, pairs changed 2\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:91, pairs changed 2\n",
      "L==H\n",
      "fullSet, iter: 4 i:92, pairs changed 2\n",
      "fullSet, iter: 4 i:93, pairs changed 3\n",
      "fullSet, iter: 4 i:94, pairs changed 4\n",
      "L==H\n",
      "fullSet, iter: 4 i:95, pairs changed 4\n",
      "fullSet, iter: 4 i:96, pairs changed 4\n",
      "fullSet, iter: 4 i:97, pairs changed 5\n",
      "fullSet, iter: 4 i:98, pairs changed 6\n",
      "j not moving enough\n",
      "fullSet, iter: 4 i:99, pairs changed 6\n",
      "iteration number: 5\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:0, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:1, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:2, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:4, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:5, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:6, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:8, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:9, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:10, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:12, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:13, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:14, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:15, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:16, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:19, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:20, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:21, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:22, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:23, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:24, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:26, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:27, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:28, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:29, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:30, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:31, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:32, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:33, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:34, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:36, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:37, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:38, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:39, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:40, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:41, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:42, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:43, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:44, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:45, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:46, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:47, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:48, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:50, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:51, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:52, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:53, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:54, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:55, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:56, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:57, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:58, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:59, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:61, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:62, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:63, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:64, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:65, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:66, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:67, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:69, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:70, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:72, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:73, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:74, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:75, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:76, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:77, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:78, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:79, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:81, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:84, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:85, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:87, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:88, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:89, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:90, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:91, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:92, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:93, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:94, pairs changed 0\n",
      "non-bound, iter: 5 i:95, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:97, pairs changed 0\n",
      "non-bound, iter: 5 i:98, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 5 i:99, pairs changed 0\n",
      "iteration number: 6\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:0, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:1, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:2, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:4, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:5, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:6, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:8, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:9, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:10, pairs changed 0\n",
      "fullSet, iter: 6 i:11, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:12, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:13, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:14, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:15, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:16, pairs changed 0\n",
      "fullSet, iter: 6 i:17, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:19, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:20, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:21, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:22, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:23, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:24, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:26, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:27, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:28, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:29, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:30, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:31, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:32, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:33, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:34, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 6 i:35, pairs changed 0\n",
      "j not moving enough\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fullSet, iter: 6 i:36, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:37, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:38, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:39, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:40, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:41, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:42, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:43, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:44, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:45, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:46, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:47, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:48, pairs changed 0\n",
      "fullSet, iter: 6 i:49, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:50, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:51, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:52, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:53, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:54, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:55, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:56, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:57, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:58, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:59, pairs changed 0\n",
      "fullSet, iter: 6 i:60, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:61, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:62, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:63, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:64, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:65, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:66, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:67, pairs changed 0\n",
      "fullSet, iter: 6 i:68, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:69, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:70, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 6 i:71, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:72, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:73, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:74, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:75, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:76, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:77, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:78, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:79, pairs changed 0\n",
      "fullSet, iter: 6 i:80, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:81, pairs changed 0\n",
      "fullSet, iter: 6 i:82, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 6 i:83, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:84, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:85, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 6 i:86, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:87, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:88, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:89, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:90, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:91, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:92, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:93, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:94, pairs changed 0\n",
      "fullSet, iter: 6 i:95, pairs changed 0\n",
      "fullSet, iter: 6 i:96, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:97, pairs changed 0\n",
      "fullSet, iter: 6 i:98, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 6 i:99, pairs changed 0\n",
      "iteration number: 7\n",
      "there are 88 Support Vectors\n",
      "the training error rate is: 0.000000\n",
      "the test error rate is: 0.080000\n"
     ]
    }
   ],
   "source": [
    "#P87\n",
    "testRbf()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "L==H\n",
      "fullSet, iter: 0 i:0, pairs changed 0\n",
      "fullSet, iter: 0 i:1, pairs changed 1\n",
      "fullSet, iter: 0 i:2, pairs changed 2\n",
      "fullSet, iter: 0 i:3, pairs changed 3\n",
      "fullSet, iter: 0 i:4, pairs changed 4\n",
      "fullSet, iter: 0 i:5, pairs changed 5\n",
      "fullSet, iter: 0 i:6, pairs changed 6\n",
      "fullSet, iter: 0 i:7, pairs changed 7\n",
      "fullSet, iter: 0 i:8, pairs changed 8\n",
      "fullSet, iter: 0 i:9, pairs changed 9\n",
      "fullSet, iter: 0 i:10, pairs changed 9\n",
      "fullSet, iter: 0 i:11, pairs changed 10\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:12, pairs changed 10\n",
      "fullSet, iter: 0 i:13, pairs changed 10\n",
      "fullSet, iter: 0 i:14, pairs changed 11\n",
      "fullSet, iter: 0 i:15, pairs changed 12\n",
      "fullSet, iter: 0 i:16, pairs changed 13\n",
      "fullSet, iter: 0 i:17, pairs changed 13\n",
      "fullSet, iter: 0 i:18, pairs changed 14\n",
      "fullSet, iter: 0 i:19, pairs changed 14\n",
      "fullSet, iter: 0 i:20, pairs changed 15\n",
      "fullSet, iter: 0 i:21, pairs changed 16\n",
      "fullSet, iter: 0 i:22, pairs changed 17\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:23, pairs changed 17\n",
      "fullSet, iter: 0 i:24, pairs changed 17\n",
      "fullSet, iter: 0 i:25, pairs changed 18\n",
      "L==H\n",
      "fullSet, iter: 0 i:26, pairs changed 18\n",
      "fullSet, iter: 0 i:27, pairs changed 19\n",
      "fullSet, iter: 0 i:28, pairs changed 20\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:29, pairs changed 20\n",
      "fullSet, iter: 0 i:30, pairs changed 20\n",
      "fullSet, iter: 0 i:31, pairs changed 20\n",
      "fullSet, iter: 0 i:32, pairs changed 20\n",
      "fullSet, iter: 0 i:33, pairs changed 20\n",
      "fullSet, iter: 0 i:34, pairs changed 20\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:35, pairs changed 20\n",
      "fullSet, iter: 0 i:36, pairs changed 21\n",
      "fullSet, iter: 0 i:37, pairs changed 22\n",
      "fullSet, iter: 0 i:38, pairs changed 22\n",
      "fullSet, iter: 0 i:39, pairs changed 23\n",
      "fullSet, iter: 0 i:40, pairs changed 23\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:41, pairs changed 23\n",
      "fullSet, iter: 0 i:42, pairs changed 23\n",
      "fullSet, iter: 0 i:43, pairs changed 23\n",
      "fullSet, iter: 0 i:44, pairs changed 24\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:45, pairs changed 24\n",
      "fullSet, iter: 0 i:46, pairs changed 24\n",
      "fullSet, iter: 0 i:47, pairs changed 24\n",
      "fullSet, iter: 0 i:48, pairs changed 24\n",
      "fullSet, iter: 0 i:49, pairs changed 25\n",
      "fullSet, iter: 0 i:50, pairs changed 25\n",
      "fullSet, iter: 0 i:51, pairs changed 26\n",
      "L==H\n",
      "fullSet, iter: 0 i:52, pairs changed 26\n",
      "fullSet, iter: 0 i:53, pairs changed 26\n",
      "L==H\n",
      "fullSet, iter: 0 i:54, pairs changed 26\n",
      "L==H\n",
      "fullSet, iter: 0 i:55, pairs changed 26\n",
      "fullSet, iter: 0 i:56, pairs changed 26\n",
      "fullSet, iter: 0 i:57, pairs changed 26\n",
      "fullSet, iter: 0 i:58, pairs changed 26\n",
      "fullSet, iter: 0 i:59, pairs changed 26\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:60, pairs changed 26\n",
      "L==H\n",
      "fullSet, iter: 0 i:61, pairs changed 26\n",
      "fullSet, iter: 0 i:62, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:63, pairs changed 27\n",
      "fullSet, iter: 0 i:64, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:65, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:66, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:67, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:68, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:69, pairs changed 27\n",
      "fullSet, iter: 0 i:70, pairs changed 27\n",
      "fullSet, iter: 0 i:71, pairs changed 27\n",
      "L==H\n",
      "fullSet, iter: 0 i:72, pairs changed 27\n",
      "fullSet, iter: 0 i:73, pairs changed 28\n",
      "L==H\n",
      "fullSet, iter: 0 i:74, pairs changed 28\n",
      "fullSet, iter: 0 i:75, pairs changed 28\n",
      "fullSet, iter: 0 i:76, pairs changed 28\n",
      "L==H\n",
      "fullSet, iter: 0 i:77, pairs changed 28\n",
      "fullSet, iter: 0 i:78, pairs changed 28\n",
      "fullSet, iter: 0 i:79, pairs changed 28\n",
      "fullSet, iter: 0 i:80, pairs changed 28\n",
      "L==H\n",
      "fullSet, iter: 0 i:81, pairs changed 28\n",
      "L==H\n",
      "fullSet, iter: 0 i:82, pairs changed 28\n",
      "L==H\n",
      "fullSet, iter: 0 i:83, pairs changed 28\n",
      "fullSet, iter: 0 i:84, pairs changed 29\n",
      "L==H\n",
      "fullSet, iter: 0 i:85, pairs changed 29\n",
      "fullSet, iter: 0 i:86, pairs changed 30\n",
      "fullSet, iter: 0 i:87, pairs changed 30\n",
      "fullSet, iter: 0 i:88, pairs changed 30\n",
      "fullSet, iter: 0 i:89, pairs changed 30\n",
      "fullSet, iter: 0 i:90, pairs changed 30\n",
      "fullSet, iter: 0 i:91, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:92, pairs changed 30\n",
      "fullSet, iter: 0 i:93, pairs changed 30\n",
      "fullSet, iter: 0 i:94, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:95, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:96, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:97, pairs changed 30\n",
      "fullSet, iter: 0 i:98, pairs changed 30\n",
      "fullSet, iter: 0 i:99, pairs changed 30\n",
      "fullSet, iter: 0 i:100, pairs changed 30\n",
      "fullSet, iter: 0 i:101, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:102, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:103, pairs changed 30\n",
      "fullSet, iter: 0 i:104, pairs changed 30\n",
      "fullSet, iter: 0 i:105, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:106, pairs changed 30\n",
      "fullSet, iter: 0 i:107, pairs changed 30\n",
      "fullSet, iter: 0 i:108, pairs changed 30\n",
      "fullSet, iter: 0 i:109, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:110, pairs changed 30\n",
      "fullSet, iter: 0 i:111, pairs changed 30\n",
      "fullSet, iter: 0 i:112, pairs changed 30\n",
      "fullSet, iter: 0 i:113, pairs changed 30\n",
      "fullSet, iter: 0 i:114, pairs changed 30\n",
      "fullSet, iter: 0 i:115, pairs changed 30\n",
      "fullSet, iter: 0 i:116, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:117, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:118, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:119, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:120, pairs changed 30\n",
      "fullSet, iter: 0 i:121, pairs changed 30\n",
      "fullSet, iter: 0 i:122, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:123, pairs changed 30\n",
      "fullSet, iter: 0 i:124, pairs changed 30\n",
      "fullSet, iter: 0 i:125, pairs changed 30\n",
      "fullSet, iter: 0 i:126, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:127, pairs changed 30\n",
      "fullSet, iter: 0 i:128, pairs changed 30\n",
      "fullSet, iter: 0 i:129, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:130, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:131, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:132, pairs changed 30\n",
      "fullSet, iter: 0 i:133, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:134, pairs changed 30\n",
      "fullSet, iter: 0 i:135, pairs changed 30\n",
      "fullSet, iter: 0 i:136, pairs changed 30\n",
      "fullSet, iter: 0 i:137, pairs changed 30\n",
      "fullSet, iter: 0 i:138, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:139, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:140, pairs changed 30\n",
      "fullSet, iter: 0 i:141, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:142, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:143, pairs changed 30\n",
      "fullSet, iter: 0 i:144, pairs changed 30\n",
      "fullSet, iter: 0 i:145, pairs changed 30\n",
      "fullSet, iter: 0 i:146, pairs changed 30\n",
      "fullSet, iter: 0 i:147, pairs changed 30\n",
      "fullSet, iter: 0 i:148, pairs changed 30\n",
      "fullSet, iter: 0 i:149, pairs changed 30\n",
      "fullSet, iter: 0 i:150, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:151, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:152, pairs changed 30\n",
      "fullSet, iter: 0 i:153, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:154, pairs changed 30\n",
      "fullSet, iter: 0 i:155, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:156, pairs changed 30\n",
      "fullSet, iter: 0 i:157, pairs changed 30\n",
      "fullSet, iter: 0 i:158, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:159, pairs changed 30\n",
      "fullSet, iter: 0 i:160, pairs changed 30\n",
      "fullSet, iter: 0 i:161, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:162, pairs changed 30\n",
      "fullSet, iter: 0 i:163, pairs changed 30\n",
      "fullSet, iter: 0 i:164, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:165, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:166, pairs changed 30\n",
      "fullSet, iter: 0 i:167, pairs changed 30\n",
      "fullSet, iter: 0 i:168, pairs changed 30\n",
      "fullSet, iter: 0 i:169, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:170, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:171, pairs changed 30\n",
      "fullSet, iter: 0 i:172, pairs changed 30\n",
      "fullSet, iter: 0 i:173, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:174, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:175, pairs changed 30\n",
      "fullSet, iter: 0 i:176, pairs changed 30\n",
      "fullSet, iter: 0 i:177, pairs changed 30\n",
      "fullSet, iter: 0 i:178, pairs changed 30\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:179, pairs changed 30\n",
      "fullSet, iter: 0 i:180, pairs changed 30\n",
      "fullSet, iter: 0 i:181, pairs changed 30\n",
      "fullSet, iter: 0 i:182, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:183, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:184, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:185, pairs changed 30\n",
      "fullSet, iter: 0 i:186, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:187, pairs changed 30\n",
      "fullSet, iter: 0 i:188, pairs changed 30\n",
      "fullSet, iter: 0 i:189, pairs changed 30\n",
      "fullSet, iter: 0 i:190, pairs changed 30\n",
      "fullSet, iter: 0 i:191, pairs changed 30\n",
      "fullSet, iter: 0 i:192, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:193, pairs changed 30\n",
      "fullSet, iter: 0 i:194, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:195, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:196, pairs changed 30\n",
      "fullSet, iter: 0 i:197, pairs changed 30\n",
      "fullSet, iter: 0 i:198, pairs changed 30\n",
      "fullSet, iter: 0 i:199, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:200, pairs changed 30\n",
      "fullSet, iter: 0 i:201, pairs changed 30\n",
      "L==H\n",
      "fullSet, iter: 0 i:202, pairs changed 30\n",
      "fullSet, iter: 0 i:203, pairs changed 30\n",
      "fullSet, iter: 0 i:204, pairs changed 30\n",
      "fullSet, iter: 0 i:205, pairs changed 30\n",
      "fullSet, iter: 0 i:206, pairs changed 30\n",
      "fullSet, iter: 0 i:207, pairs changed 30\n",
      "fullSet, iter: 0 i:208, pairs changed 30\n",
      "fullSet, iter: 0 i:209, pairs changed 30\n",
      "fullSet, iter: 0 i:210, pairs changed 30\n",
      "fullSet, iter: 0 i:211, pairs changed 30\n",
      "fullSet, iter: 0 i:212, pairs changed 30\n",
      "fullSet, iter: 0 i:213, pairs changed 31\n",
      "fullSet, iter: 0 i:214, pairs changed 31\n",
      "fullSet, iter: 0 i:215, pairs changed 31\n",
      "fullSet, iter: 0 i:216, pairs changed 31\n",
      "fullSet, iter: 0 i:217, pairs changed 31\n",
      "fullSet, iter: 0 i:218, pairs changed 31\n",
      "fullSet, iter: 0 i:219, pairs changed 31\n",
      "fullSet, iter: 0 i:220, pairs changed 31\n",
      "fullSet, iter: 0 i:221, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:222, pairs changed 31\n",
      "fullSet, iter: 0 i:223, pairs changed 31\n",
      "fullSet, iter: 0 i:224, pairs changed 31\n",
      "fullSet, iter: 0 i:225, pairs changed 31\n",
      "fullSet, iter: 0 i:226, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:227, pairs changed 31\n",
      "fullSet, iter: 0 i:228, pairs changed 31\n",
      "fullSet, iter: 0 i:229, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:230, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:231, pairs changed 31\n",
      "fullSet, iter: 0 i:232, pairs changed 31\n",
      "fullSet, iter: 0 i:233, pairs changed 31\n",
      "fullSet, iter: 0 i:234, pairs changed 31\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:235, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:236, pairs changed 31\n",
      "fullSet, iter: 0 i:237, pairs changed 31\n",
      "fullSet, iter: 0 i:238, pairs changed 31\n",
      "fullSet, iter: 0 i:239, pairs changed 31\n",
      "fullSet, iter: 0 i:240, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:241, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:242, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:243, pairs changed 31\n",
      "fullSet, iter: 0 i:244, pairs changed 31\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:245, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:246, pairs changed 31\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:247, pairs changed 31\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:248, pairs changed 31\n",
      "fullSet, iter: 0 i:249, pairs changed 31\n",
      "fullSet, iter: 0 i:250, pairs changed 31\n",
      "fullSet, iter: 0 i:251, pairs changed 31\n",
      "fullSet, iter: 0 i:252, pairs changed 31\n",
      "fullSet, iter: 0 i:253, pairs changed 31\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:254, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:255, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:256, pairs changed 31\n",
      "fullSet, iter: 0 i:257, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:258, pairs changed 31\n",
      "fullSet, iter: 0 i:259, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:260, pairs changed 31\n",
      "L==H\n",
      "fullSet, iter: 0 i:261, pairs changed 31\n",
      "fullSet, iter: 0 i:262, pairs changed 32\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:263, pairs changed 32\n",
      "fullSet, iter: 0 i:264, pairs changed 32\n",
      "fullSet, iter: 0 i:265, pairs changed 32\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:266, pairs changed 32\n",
      "fullSet, iter: 0 i:267, pairs changed 32\n",
      "fullSet, iter: 0 i:268, pairs changed 32\n",
      "fullSet, iter: 0 i:269, pairs changed 32\n",
      "fullSet, iter: 0 i:270, pairs changed 32\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "fullSet, iter: 0 i:271, pairs changed 32\n",
      "L==H\n",
      "fullSet, iter: 0 i:272, pairs changed 32\n",
      "fullSet, iter: 0 i:273, pairs changed 32\n",
      "fullSet, iter: 0 i:274, pairs changed 32\n",
      "fullSet, iter: 0 i:275, pairs changed 33\n",
      "fullSet, iter: 0 i:276, pairs changed 33\n",
      "fullSet, iter: 0 i:277, pairs changed 33\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:278, pairs changed 33\n",
      "fullSet, iter: 0 i:279, pairs changed 33\n",
      "fullSet, iter: 0 i:280, pairs changed 33\n",
      "fullSet, iter: 0 i:281, pairs changed 33\n",
      "fullSet, iter: 0 i:282, pairs changed 33\n",
      "fullSet, iter: 0 i:283, pairs changed 34\n",
      "fullSet, iter: 0 i:284, pairs changed 34\n",
      "fullSet, iter: 0 i:285, pairs changed 35\n",
      "L==H\n",
      "fullSet, iter: 0 i:286, pairs changed 35\n",
      "fullSet, iter: 0 i:287, pairs changed 36\n",
      "fullSet, iter: 0 i:288, pairs changed 36\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:289, pairs changed 36\n",
      "fullSet, iter: 0 i:290, pairs changed 36\n",
      "fullSet, iter: 0 i:291, pairs changed 36\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:292, pairs changed 36\n",
      "fullSet, iter: 0 i:293, pairs changed 36\n",
      "fullSet, iter: 0 i:294, pairs changed 37\n",
      "fullSet, iter: 0 i:295, pairs changed 37\n",
      "L==H\n",
      "fullSet, iter: 0 i:296, pairs changed 37\n",
      "fullSet, iter: 0 i:297, pairs changed 37\n",
      "fullSet, iter: 0 i:298, pairs changed 38\n",
      "fullSet, iter: 0 i:299, pairs changed 38\n",
      "fullSet, iter: 0 i:300, pairs changed 38\n",
      "fullSet, iter: 0 i:301, pairs changed 38\n",
      "fullSet, iter: 0 i:302, pairs changed 38\n",
      "L==H\n",
      "fullSet, iter: 0 i:303, pairs changed 38\n",
      "fullSet, iter: 0 i:304, pairs changed 38\n",
      "fullSet, iter: 0 i:305, pairs changed 38\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:306, pairs changed 38\n",
      "fullSet, iter: 0 i:307, pairs changed 38\n",
      "fullSet, iter: 0 i:308, pairs changed 39\n",
      "fullSet, iter: 0 i:309, pairs changed 39\n",
      "fullSet, iter: 0 i:310, pairs changed 39\n",
      "fullSet, iter: 0 i:311, pairs changed 39\n",
      "fullSet, iter: 0 i:312, pairs changed 39\n",
      "fullSet, iter: 0 i:313, pairs changed 39\n",
      "fullSet, iter: 0 i:314, pairs changed 39\n",
      "fullSet, iter: 0 i:315, pairs changed 39\n",
      "fullSet, iter: 0 i:316, pairs changed 39\n",
      "fullSet, iter: 0 i:317, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:318, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:319, pairs changed 39\n",
      "fullSet, iter: 0 i:320, pairs changed 39\n",
      "fullSet, iter: 0 i:321, pairs changed 39\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:322, pairs changed 39\n",
      "fullSet, iter: 0 i:323, pairs changed 39\n",
      "fullSet, iter: 0 i:324, pairs changed 39\n",
      "fullSet, iter: 0 i:325, pairs changed 39\n",
      "fullSet, iter: 0 i:326, pairs changed 39\n",
      "fullSet, iter: 0 i:327, pairs changed 39\n",
      "fullSet, iter: 0 i:328, pairs changed 39\n",
      "fullSet, iter: 0 i:329, pairs changed 39\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:330, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:331, pairs changed 39\n",
      "fullSet, iter: 0 i:332, pairs changed 39\n",
      "fullSet, iter: 0 i:333, pairs changed 39\n",
      "fullSet, iter: 0 i:334, pairs changed 39\n",
      "fullSet, iter: 0 i:335, pairs changed 39\n",
      "fullSet, iter: 0 i:336, pairs changed 39\n",
      "fullSet, iter: 0 i:337, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:338, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:339, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:340, pairs changed 39\n",
      "fullSet, iter: 0 i:341, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:342, pairs changed 39\n",
      "fullSet, iter: 0 i:343, pairs changed 39\n",
      "fullSet, iter: 0 i:344, pairs changed 39\n",
      "fullSet, iter: 0 i:345, pairs changed 39\n",
      "fullSet, iter: 0 i:346, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:347, pairs changed 39\n",
      "fullSet, iter: 0 i:348, pairs changed 39\n",
      "fullSet, iter: 0 i:349, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:350, pairs changed 39\n",
      "fullSet, iter: 0 i:351, pairs changed 39\n",
      "fullSet, iter: 0 i:352, pairs changed 39\n",
      "fullSet, iter: 0 i:353, pairs changed 39\n",
      "fullSet, iter: 0 i:354, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:355, pairs changed 39\n",
      "fullSet, iter: 0 i:356, pairs changed 39\n",
      "fullSet, iter: 0 i:357, pairs changed 39\n",
      "fullSet, iter: 0 i:358, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:359, pairs changed 39\n",
      "fullSet, iter: 0 i:360, pairs changed 39\n",
      "fullSet, iter: 0 i:361, pairs changed 39\n",
      "fullSet, iter: 0 i:362, pairs changed 39\n",
      "fullSet, iter: 0 i:363, pairs changed 39\n",
      "fullSet, iter: 0 i:364, pairs changed 39\n",
      "fullSet, iter: 0 i:365, pairs changed 39\n",
      "fullSet, iter: 0 i:366, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:367, pairs changed 39\n",
      "L==H\n",
      "fullSet, iter: 0 i:368, pairs changed 39\n",
      "fullSet, iter: 0 i:369, pairs changed 39\n",
      "fullSet, iter: 0 i:370, pairs changed 40\n",
      "fullSet, iter: 0 i:371, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:372, pairs changed 40\n",
      "fullSet, iter: 0 i:373, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:374, pairs changed 40\n",
      "fullSet, iter: 0 i:375, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:376, pairs changed 40\n",
      "fullSet, iter: 0 i:377, pairs changed 40\n",
      "fullSet, iter: 0 i:378, pairs changed 40\n",
      "fullSet, iter: 0 i:379, pairs changed 40\n",
      "fullSet, iter: 0 i:380, pairs changed 40\n",
      "fullSet, iter: 0 i:381, pairs changed 40\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:382, pairs changed 40\n",
      "fullSet, iter: 0 i:383, pairs changed 40\n",
      "j not moving enough\n",
      "fullSet, iter: 0 i:384, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:385, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:386, pairs changed 40\n",
      "fullSet, iter: 0 i:387, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:388, pairs changed 40\n",
      "fullSet, iter: 0 i:389, pairs changed 40\n",
      "fullSet, iter: 0 i:390, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:391, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:392, pairs changed 40\n",
      "fullSet, iter: 0 i:393, pairs changed 40\n",
      "fullSet, iter: 0 i:394, pairs changed 40\n",
      "fullSet, iter: 0 i:395, pairs changed 40\n",
      "fullSet, iter: 0 i:396, pairs changed 40\n",
      "L==H\n",
      "fullSet, iter: 0 i:397, pairs changed 40\n",
      "fullSet, iter: 0 i:398, pairs changed 40\n",
      "fullSet, iter: 0 i:399, pairs changed 40\n",
      "fullSet, iter: 0 i:400, pairs changed 40\n",
      "fullSet, iter: 0 i:401, pairs changed 40\n",
      "iteration number: 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:0, pairs changed 0\n",
      "non-bound, iter: 1 i:2, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:3, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:5, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:6, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:7, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:8, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:9, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:11, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:14, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:16, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:18, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:20, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:22, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:25, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:26, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:27, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:28, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:36, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:37, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:44, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:49, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:62, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:63, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:69, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:73, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:84, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:85, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:86, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:92, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:131, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:174, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:183, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:184, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:213, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:256, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:262, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:275, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:283, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:285, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:287, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:294, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:296, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:298, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:308, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:367, pairs changed 1\n",
      "j not moving enough\n",
      "non-bound, iter: 1 i:370, pairs changed 1\n",
      "iteration number: 2\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:0, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:5, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:6, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:8, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:9, pairs changed 0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "non-bound, iter: 2 i:11, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:14, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:16, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:20, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:22, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:26, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:27, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:28, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:36, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:37, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:44, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:49, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:62, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:63, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:69, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:73, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:84, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:85, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:86, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:92, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:131, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:174, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:183, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:184, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:213, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:256, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:262, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:275, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:283, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:285, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:287, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:294, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:296, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:298, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:308, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:367, pairs changed 0\n",
      "j not moving enough\n",
      "non-bound, iter: 2 i:370, pairs changed 0\n",
      "non-bound, iter: 2 i:385, pairs changed 0\n",
      "iteration number: 3\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:0, pairs changed 0\n",
      "fullSet, iter: 3 i:1, pairs changed 0\n",
      "fullSet, iter: 3 i:2, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:3, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:4, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:5, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:6, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:7, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:8, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:9, pairs changed 0\n",
      "fullSet, iter: 3 i:10, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:11, pairs changed 0\n",
      "fullSet, iter: 3 i:12, pairs changed 0\n",
      "fullSet, iter: 3 i:13, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:14, pairs changed 0\n",
      "fullSet, iter: 3 i:15, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:16, pairs changed 0\n",
      "fullSet, iter: 3 i:17, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:18, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:19, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:20, pairs changed 0\n",
      "fullSet, iter: 3 i:21, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:22, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:23, pairs changed 0\n",
      "fullSet, iter: 3 i:24, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:25, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:26, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:27, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:28, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:29, pairs changed 0\n",
      "fullSet, iter: 3 i:30, pairs changed 0\n",
      "fullSet, iter: 3 i:31, pairs changed 0\n",
      "fullSet, iter: 3 i:32, pairs changed 0\n",
      "fullSet, iter: 3 i:33, pairs changed 0\n",
      "fullSet, iter: 3 i:34, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:35, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:36, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:37, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:38, pairs changed 0\n",
      "fullSet, iter: 3 i:39, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:40, pairs changed 0\n",
      "fullSet, iter: 3 i:41, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:42, pairs changed 0\n",
      "fullSet, iter: 3 i:43, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:44, pairs changed 0\n",
      "fullSet, iter: 3 i:45, pairs changed 0\n",
      "fullSet, iter: 3 i:46, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:47, pairs changed 0\n",
      "fullSet, iter: 3 i:48, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:49, pairs changed 0\n",
      "fullSet, iter: 3 i:50, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:51, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:52, pairs changed 0\n",
      "fullSet, iter: 3 i:53, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:54, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:55, pairs changed 0\n",
      "fullSet, iter: 3 i:56, pairs changed 0\n",
      "fullSet, iter: 3 i:57, pairs changed 0\n",
      "fullSet, iter: 3 i:58, pairs changed 0\n",
      "fullSet, iter: 3 i:59, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:60, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:61, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:62, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:63, pairs changed 0\n",
      "fullSet, iter: 3 i:64, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:65, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:66, pairs changed 0\n",
      "fullSet, iter: 3 i:67, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:68, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:69, pairs changed 0\n",
      "fullSet, iter: 3 i:70, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:71, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:72, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:73, pairs changed 0\n",
      "fullSet, iter: 3 i:74, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:75, pairs changed 0\n",
      "fullSet, iter: 3 i:76, pairs changed 0\n",
      "fullSet, iter: 3 i:77, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:78, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:79, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:80, pairs changed 0\n",
      "fullSet, iter: 3 i:81, pairs changed 0\n",
      "fullSet, iter: 3 i:82, pairs changed 0\n",
      "fullSet, iter: 3 i:83, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:84, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:85, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:86, pairs changed 0\n",
      "fullSet, iter: 3 i:87, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:88, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:89, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:90, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:91, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:92, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:93, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:94, pairs changed 0\n",
      "fullSet, iter: 3 i:95, pairs changed 0\n",
      "fullSet, iter: 3 i:96, pairs changed 0\n",
      "fullSet, iter: 3 i:97, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:98, pairs changed 0\n",
      "fullSet, iter: 3 i:99, pairs changed 0\n",
      "fullSet, iter: 3 i:100, pairs changed 0\n",
      "fullSet, iter: 3 i:101, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:102, pairs changed 0\n",
      "fullSet, iter: 3 i:103, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:104, pairs changed 0\n",
      "fullSet, iter: 3 i:105, pairs changed 0\n",
      "fullSet, iter: 3 i:106, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:107, pairs changed 0\n",
      "fullSet, iter: 3 i:108, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:109, pairs changed 0\n",
      "fullSet, iter: 3 i:110, pairs changed 0\n",
      "fullSet, iter: 3 i:111, pairs changed 0\n",
      "fullSet, iter: 3 i:112, pairs changed 0\n",
      "fullSet, iter: 3 i:113, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:114, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:115, pairs changed 0\n",
      "fullSet, iter: 3 i:116, pairs changed 0\n",
      "fullSet, iter: 3 i:117, pairs changed 0\n",
      "fullSet, iter: 3 i:118, pairs changed 0\n",
      "fullSet, iter: 3 i:119, pairs changed 0\n",
      "fullSet, iter: 3 i:120, pairs changed 0\n",
      "fullSet, iter: 3 i:121, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:122, pairs changed 0\n",
      "fullSet, iter: 3 i:123, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:124, pairs changed 0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "fullSet, iter: 3 i:125, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:126, pairs changed 0\n",
      "fullSet, iter: 3 i:127, pairs changed 0\n",
      "fullSet, iter: 3 i:128, pairs changed 0\n",
      "fullSet, iter: 3 i:129, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:130, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:131, pairs changed 0\n",
      "fullSet, iter: 3 i:132, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:133, pairs changed 0\n",
      "fullSet, iter: 3 i:134, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:135, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:136, pairs changed 0\n",
      "fullSet, iter: 3 i:137, pairs changed 0\n",
      "fullSet, iter: 3 i:138, pairs changed 0\n",
      "fullSet, iter: 3 i:139, pairs changed 0\n",
      "fullSet, iter: 3 i:140, pairs changed 0\n",
      "fullSet, iter: 3 i:141, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:142, pairs changed 0\n",
      "fullSet, iter: 3 i:143, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:144, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:145, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:146, pairs changed 0\n",
      "fullSet, iter: 3 i:147, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:148, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:149, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:150, pairs changed 0\n",
      "fullSet, iter: 3 i:151, pairs changed 0\n",
      "fullSet, iter: 3 i:152, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:153, pairs changed 0\n",
      "fullSet, iter: 3 i:154, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:155, pairs changed 0\n",
      "fullSet, iter: 3 i:156, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:157, pairs changed 0\n",
      "fullSet, iter: 3 i:158, pairs changed 0\n",
      "fullSet, iter: 3 i:159, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:160, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:161, pairs changed 0\n",
      "fullSet, iter: 3 i:162, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:163, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:164, pairs changed 0\n",
      "fullSet, iter: 3 i:165, pairs changed 0\n",
      "fullSet, iter: 3 i:166, pairs changed 0\n",
      "fullSet, iter: 3 i:167, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:168, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:169, pairs changed 0\n",
      "fullSet, iter: 3 i:170, pairs changed 0\n",
      "fullSet, iter: 3 i:171, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:172, pairs changed 0\n",
      "fullSet, iter: 3 i:173, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:174, pairs changed 0\n",
      "fullSet, iter: 3 i:175, pairs changed 0\n",
      "fullSet, iter: 3 i:176, pairs changed 0\n",
      "fullSet, iter: 3 i:177, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:178, pairs changed 0\n",
      "fullSet, iter: 3 i:179, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:180, pairs changed 0\n",
      "fullSet, iter: 3 i:181, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:182, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:183, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:184, pairs changed 0\n",
      "fullSet, iter: 3 i:185, pairs changed 0\n",
      "fullSet, iter: 3 i:186, pairs changed 0\n",
      "fullSet, iter: 3 i:187, pairs changed 0\n",
      "fullSet, iter: 3 i:188, pairs changed 0\n",
      "fullSet, iter: 3 i:189, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:190, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:191, pairs changed 0\n",
      "fullSet, iter: 3 i:192, pairs changed 0\n",
      "fullSet, iter: 3 i:193, pairs changed 0\n",
      "fullSet, iter: 3 i:194, pairs changed 0\n",
      "fullSet, iter: 3 i:195, pairs changed 0\n",
      "fullSet, iter: 3 i:196, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:197, pairs changed 0\n",
      "fullSet, iter: 3 i:198, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:199, pairs changed 0\n",
      "fullSet, iter: 3 i:200, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:201, pairs changed 0\n",
      "fullSet, iter: 3 i:202, pairs changed 0\n",
      "fullSet, iter: 3 i:203, pairs changed 0\n",
      "fullSet, iter: 3 i:204, pairs changed 0\n",
      "fullSet, iter: 3 i:205, pairs changed 0\n",
      "fullSet, iter: 3 i:206, pairs changed 0\n",
      "fullSet, iter: 3 i:207, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:208, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:209, pairs changed 0\n",
      "fullSet, iter: 3 i:210, pairs changed 0\n",
      "fullSet, iter: 3 i:211, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:212, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:213, pairs changed 0\n",
      "fullSet, iter: 3 i:214, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:215, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:216, pairs changed 0\n",
      "fullSet, iter: 3 i:217, pairs changed 0\n",
      "fullSet, iter: 3 i:218, pairs changed 0\n",
      "fullSet, iter: 3 i:219, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:220, pairs changed 0\n",
      "fullSet, iter: 3 i:221, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:222, pairs changed 0\n",
      "fullSet, iter: 3 i:223, pairs changed 0\n",
      "fullSet, iter: 3 i:224, pairs changed 0\n",
      "fullSet, iter: 3 i:225, pairs changed 0\n",
      "fullSet, iter: 3 i:226, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:227, pairs changed 0\n",
      "fullSet, iter: 3 i:228, pairs changed 0\n",
      "fullSet, iter: 3 i:229, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:230, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:231, pairs changed 0\n",
      "fullSet, iter: 3 i:232, pairs changed 0\n",
      "fullSet, iter: 3 i:233, pairs changed 0\n",
      "fullSet, iter: 3 i:234, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:235, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:236, pairs changed 0\n",
      "fullSet, iter: 3 i:237, pairs changed 0\n",
      "fullSet, iter: 3 i:238, pairs changed 0\n",
      "fullSet, iter: 3 i:239, pairs changed 0\n",
      "fullSet, iter: 3 i:240, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:241, pairs changed 0\n",
      "fullSet, iter: 3 i:242, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:243, pairs changed 0\n",
      "fullSet, iter: 3 i:244, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:245, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:246, pairs changed 0\n",
      "fullSet, iter: 3 i:247, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:248, pairs changed 0\n",
      "fullSet, iter: 3 i:249, pairs changed 0\n",
      "fullSet, iter: 3 i:250, pairs changed 0\n",
      "fullSet, iter: 3 i:251, pairs changed 0\n",
      "fullSet, iter: 3 i:252, pairs changed 0\n",
      "fullSet, iter: 3 i:253, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:254, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:255, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:256, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:257, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:258, pairs changed 0\n",
      "fullSet, iter: 3 i:259, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:260, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:261, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:262, pairs changed 0\n",
      "fullSet, iter: 3 i:263, pairs changed 0\n",
      "fullSet, iter: 3 i:264, pairs changed 0\n",
      "fullSet, iter: 3 i:265, pairs changed 0\n",
      "fullSet, iter: 3 i:266, pairs changed 0\n",
      "fullSet, iter: 3 i:267, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:268, pairs changed 0\n",
      "fullSet, iter: 3 i:269, pairs changed 0\n",
      "fullSet, iter: 3 i:270, pairs changed 0\n",
      "fullSet, iter: 3 i:271, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:272, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:273, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:274, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:275, pairs changed 0\n",
      "fullSet, iter: 3 i:276, pairs changed 0\n",
      "fullSet, iter: 3 i:277, pairs changed 0\n",
      "fullSet, iter: 3 i:278, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:279, pairs changed 0\n",
      "fullSet, iter: 3 i:280, pairs changed 0\n",
      "fullSet, iter: 3 i:281, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:282, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:283, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:284, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:285, pairs changed 0\n",
      "fullSet, iter: 3 i:286, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:287, pairs changed 0\n",
      "fullSet, iter: 3 i:288, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:289, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:290, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:291, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:292, pairs changed 0\n",
      "fullSet, iter: 3 i:293, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:294, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:295, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:296, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:297, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:298, pairs changed 0\n",
      "fullSet, iter: 3 i:299, pairs changed 0\n",
      "fullSet, iter: 3 i:300, pairs changed 0\n",
      "fullSet, iter: 3 i:301, pairs changed 0\n",
      "fullSet, iter: 3 i:302, pairs changed 0\n",
      "fullSet, iter: 3 i:303, pairs changed 0\n",
      "fullSet, iter: 3 i:304, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:305, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:306, pairs changed 0\n",
      "fullSet, iter: 3 i:307, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:308, pairs changed 0\n",
      "fullSet, iter: 3 i:309, pairs changed 0\n",
      "fullSet, iter: 3 i:310, pairs changed 0\n",
      "fullSet, iter: 3 i:311, pairs changed 0\n",
      "fullSet, iter: 3 i:312, pairs changed 0\n",
      "fullSet, iter: 3 i:313, pairs changed 0\n",
      "fullSet, iter: 3 i:314, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:315, pairs changed 0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "j not moving enough\n",
      "fullSet, iter: 3 i:316, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:317, pairs changed 0\n",
      "fullSet, iter: 3 i:318, pairs changed 0\n",
      "fullSet, iter: 3 i:319, pairs changed 0\n",
      "fullSet, iter: 3 i:320, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:321, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:322, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:323, pairs changed 0\n",
      "fullSet, iter: 3 i:324, pairs changed 0\n",
      "fullSet, iter: 3 i:325, pairs changed 0\n",
      "fullSet, iter: 3 i:326, pairs changed 0\n",
      "fullSet, iter: 3 i:327, pairs changed 0\n",
      "fullSet, iter: 3 i:328, pairs changed 0\n",
      "fullSet, iter: 3 i:329, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:330, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:331, pairs changed 0\n",
      "fullSet, iter: 3 i:332, pairs changed 0\n",
      "fullSet, iter: 3 i:333, pairs changed 0\n",
      "fullSet, iter: 3 i:334, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:335, pairs changed 0\n",
      "fullSet, iter: 3 i:336, pairs changed 0\n",
      "fullSet, iter: 3 i:337, pairs changed 0\n",
      "fullSet, iter: 3 i:338, pairs changed 0\n",
      "fullSet, iter: 3 i:339, pairs changed 0\n",
      "fullSet, iter: 3 i:340, pairs changed 0\n",
      "fullSet, iter: 3 i:341, pairs changed 0\n",
      "fullSet, iter: 3 i:342, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:343, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:344, pairs changed 0\n",
      "fullSet, iter: 3 i:345, pairs changed 0\n",
      "fullSet, iter: 3 i:346, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:347, pairs changed 0\n",
      "fullSet, iter: 3 i:348, pairs changed 0\n",
      "fullSet, iter: 3 i:349, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:350, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:351, pairs changed 0\n",
      "fullSet, iter: 3 i:352, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:353, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:354, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:355, pairs changed 0\n",
      "fullSet, iter: 3 i:356, pairs changed 0\n",
      "fullSet, iter: 3 i:357, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:358, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:359, pairs changed 0\n",
      "fullSet, iter: 3 i:360, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:361, pairs changed 0\n",
      "fullSet, iter: 3 i:362, pairs changed 0\n",
      "fullSet, iter: 3 i:363, pairs changed 0\n",
      "fullSet, iter: 3 i:364, pairs changed 0\n",
      "fullSet, iter: 3 i:365, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:366, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:367, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:368, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:369, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:370, pairs changed 0\n",
      "L==H\n",
      "fullSet, iter: 3 i:371, pairs changed 0\n",
      "fullSet, iter: 3 i:372, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:373, pairs changed 0\n",
      "fullSet, iter: 3 i:374, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:375, pairs changed 0\n",
      "fullSet, iter: 3 i:376, pairs changed 0\n",
      "fullSet, iter: 3 i:377, pairs changed 0\n",
      "fullSet, iter: 3 i:378, pairs changed 0\n",
      "fullSet, iter: 3 i:379, pairs changed 0\n",
      "fullSet, iter: 3 i:380, pairs changed 0\n",
      "fullSet, iter: 3 i:381, pairs changed 0\n",
      "fullSet, iter: 3 i:382, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:383, pairs changed 0\n",
      "fullSet, iter: 3 i:384, pairs changed 0\n",
      "fullSet, iter: 3 i:385, pairs changed 0\n",
      "fullSet, iter: 3 i:386, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:387, pairs changed 0\n",
      "fullSet, iter: 3 i:388, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:389, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:390, pairs changed 0\n",
      "fullSet, iter: 3 i:391, pairs changed 0\n",
      "fullSet, iter: 3 i:392, pairs changed 0\n",
      "fullSet, iter: 3 i:393, pairs changed 0\n",
      "fullSet, iter: 3 i:394, pairs changed 0\n",
      "fullSet, iter: 3 i:395, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:396, pairs changed 0\n",
      "fullSet, iter: 3 i:397, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:398, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:399, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:400, pairs changed 0\n",
      "j not moving enough\n",
      "fullSet, iter: 3 i:401, pairs changed 0\n",
      "iteration number: 4\n",
      "there are 47 Support Vectors\n",
      "the training error rate is: 0.014925\n",
      "the test error rate is: 0.016129\n"
     ]
    }
   ],
   "source": [
    "testDigits(('rbf', 20))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
